/*
 * RandomizedTile.java
 *
 * Created on 29. Dezember 2006, 22:25
 *
 * Copyright (c) 2007 Daniel Gronau
 *
 * This file is part of KanjiTori.
 *
 * KanjiTori is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * KanjiTori is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

package kanjitori.map.tile;

import com.jme.scene.Node;
import java.util.HashMap;
import java.util.Map;
import kanjitori.util.Randomizer;

/**
 *
 * @author Pirx
 */
public class RandomizedTile /*extends AbstractTile implements Tile */{
    
   /* private Randomizer<Tile> randomizer;
    private Tile[] tiles;
    private int[] probs;
    
    public RandomizedTile(String name, Tile[] tiles, int[] probs) {
        super(name);
        if (tiles.length != probs.length) {
            throw new IllegalArgumentException("Number of tiles <> number of probabilities");
        }
        this.tiles = tiles;
        this.probs = probs;
        init();
    }    
        
    public void init() {    
        this.randomizer = new Randomizer<Tile>(tiles, probs);
    }    
    
    public RandomizedTile() {
    }
    
    public Node getNode() {
        if (randomizer == null) {
            init();
        }
        //return randomizer.get().getNode();
        return null;
    }

    public void setParams(Map<String, String> params) {
        tiles = new Tile[params.size()];
        probs = new int[params.size()];
        int i = 0;
        for (Map.Entry<String,String> e : params.entrySet()) {
            tiles[i] = getTile(e.getKey());
            probs[i++] = Integer.parseInt(e.getValue());
        }
    }

    public Map<String, String> getParams() {
        Map<String,String> params = new HashMap<String, String>();
        for (int i = 0; i < tiles.length; i++) {
            params.put(tiles[i].getName(), "" + probs[i]);
        }
        return params;
    }*/
    
}
